package com.unknown.common.util;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

public class ActivityUtils {

    public static void startActivity(Context source, Class<?> destination, boolean finish) {
        startActivity(source, source, destination, finish);
    }

    private static void startActivity(Context context, Context source, Class<?> destination, boolean finish) {
        context.startActivity(new Intent(source, destination));
        if (context instanceof Activity && finish) {
            ((Activity) context).finish();
        }
    }
}
